/**
 * build_project
 * <p>
 * Copyright 2014 cayden.cn, Inc. All rights reserved.
 *
 * @author Administrator
 * @date 2021-07-01 11:22
 */
package com.cayden.config.commons.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.data.domain.Persistable;

import java.beans.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author cayden
 * @date 2021-07-01 11:22
 */
public interface Entityable extends Serializable, Persistable<Serializable> {

    Serializable getId();

    Date getCreateTime();

    void setCreateTime(Date date);

    Date getUpdateTime();

    void setUpdateTime(Date date);

    @Transient
    @JsonIgnore
    default boolean isNew() {
        return null == getId();
    }
}
